package com.springboot.project.common;

public enum ExcelResultEnum {

    SUCCESS(0, "成功"),

    EXCEL_NOTFOUND_SHEET(2000, "没有找到Sheet工作表"),

    ERROR_SERVER(5000, "服务器异常"),
    ERROR_OPERATE(5001, "操作失败");

    private Integer code;

    private String desc;

    private ExcelResultEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static ExcelResultEnum valueOf(Integer code) {
        for (ExcelResultEnum returnCode : values()) {
            if (code.equals(returnCode.code)) {
                return returnCode;
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public String getCodeStr() {
        return code.toString();
    }


    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
